package com.lndsnx.callback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @Description Rabbit 配置
 * @Author lndsnx
 * @Date 2025/7/30 上午9:50
 */
@Slf4j
public class RabbitReturnCallback implements RabbitTemplate.ReturnsCallback {

    @Override
    public void returnedMessage(ReturnedMessage returnedMessage) {
        log.info("message return message: {}, replyCode: {}, replyText: {}, exchange: {}, routingKey: {}",
                returnedMessage.getMessage().toString(), returnedMessage.getReplyCode(), returnedMessage.getReplyText(), returnedMessage.getExchange(), returnedMessage.getRoutingKey());
    }
}
